-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix type annotation for pandas.core.generic.py #25909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@vaibhavhrt could you also take care of the following? pandas/core/frame.py:368: error: Need type annotation for '_accessors' Very similar problem mentioned in issue I think makes sense to knock out together |
@WillAyd Sure I will take care of frames.py too |
There is a little problem with frame.py, I am getting this error instead of what you wrote in your comment:
And I can't fix it even after adding type. Still getting the same(almost) error.
Most likely because I just set type of |
I think just using Set consistently should be fine.
…Sent from my iPhone
On Mar 28, 2019, at 6:24 AM, Vaibhav Vishal ***@***.***> wrote:
There is a little problem with frame.py, I am getting this error instead of what you wrote in your comment:
pandas\core\frame.py:368: error: Incompatible types in assignment (expression has type "Set[<nothing>]", base class "NDFrame" defined the type as "FrozenSet[str]")
And I can't fix it even after adding type. Still getting the same(almost) error.
pandas\core\frame.py:368: error: Incompatible types in assignment (expression has type "Set[str]", base class "NDFrame" defined the type as "FrozenSet[str]")
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Alright I will replace |
Codecov Report
@@ Coverage Diff @@
## master #25909 +/- ##
=========================================
Coverage ? 91.56%
=========================================
Files ? 175
Lines ? 52776
Branches ? 0
=========================================
Hits ? 48322
Misses ? 4454
Partials ? 0
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25909 +/- ##
==========================================
- Coverage 91.96% 91.95% -0.01%
==========================================
Files 175 175
Lines 52405 52406 +1
==========================================
- Hits 48193 48189 -4
- Misses 4212 4217 +5
Continue to review full report at Codecov.
|
@vaibhavhrt yes change both |
I have already changed it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm @jreback
also pls merge master |
@jreback Yeah I saw the conflicts, looks like master updated after I started working on it. I will take care of that too. |
@jreback I have made changes as requested. Please review it when you find some time. |
It is required because it can’t infer from the declaration what type of objects the set should hold.
…Sent from my iPhone
On Apr 8, 2019, at 11:29 AM, jbrockmendel ***@***.***> wrote:
@jbrockmendel commented on this pull request.
In pandas/core/frame.py:
> @@ -363,10 +363,11 @@ class DataFrame(NDFrame):
def _constructor(self):
return DataFrame
- _constructor_sliced = Series
- _deprecations = NDFrame._deprecations | frozenset(
- ['get_value', 'set_value', 'from_csv', 'from_items'])
- _accessors = set()
+ _constructor_sliced = Series # type: Type[Series]
+ _deprecations = NDFrame._deprecations | frozenset([
+ 'get_value', 'set_value', 'from_csv', 'from_items'
+ ]) # type: FrozenSet[str]
+ _accessors = set() # type: Set[str]
@WillAyd Im still not clear on what the upside from this added verbosity is. Can mypy really not figure out that set() is a set?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@vaibhavhrt can you merge master? |
@WillAyd master merged. |
thanks @vaibhavhrt |
Thanks for merging, I will pick up some new issues tomorrow. |
Also remove this module from mypy.ini
git diff upstream/master -u -- "*.py" | flake8 --diff